package com.mks.demo.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

/**
 * @Description 自动注册所有“@ServerEndpoint”注解声明的Websocket Endpoint
 * @Author hailong <1105744725@qq.com>
 * @Version V1.0.0
 * @Since 1.0
 * @Date 2019/5/29 19:26
 *
 * 打war包时需要把@Configuration 注释.本地运行需要启用注解
 */
@Configuration
public class WebSocketConfig {

    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }
}
